import fetch from 'common/src/utils/fetch'
import UTILS from "common/src/utils/utils";

const api_name = 'api/welcomeservice'
const group_name = 'tutorChangeLog'
const group_name_two = 'tutorList'
const group_name_three = 'tutorCount'
const group_name_four = 'tutorStudent'
const group_name_five = 'tutorGuidanceRecords'

//理论课
function labourTheoryScorelist(data){//查询理论成绩
    return fetch ({
        url:'/api/scoremanagementservice/labourTheoryScore/list',
        data,
        method:'post',

    })
}
//输入学号带入学生信息
function StudentInformation(data){//查询理论成绩
  return fetch ({
      url:`/api/scoremanagementservice/labourTheoryScore/${data}`,
      method:'get',

  })
}

//添加
function labourTheoryScoreAdd(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourTheoryScore',
      data,
      method:'post',

  })
}

//编辑
function labourTheoryScoreedit(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourTheoryScore',
      data,
      method:'put',

  })
}

//删除
function labourTheoryScoreDel(data){
  return fetch ({
      url:`/api/scoremanagementservice/labourTheoryScore`,
      method:'DELETE',
      data

  })
}

//详情
function labourTheoryDetails(id){
  return fetch ({
      url:`/api/scoremanagementservice/labourTheoryScore/${id}`,
      method:'get',

  })
}


function LaborEducation(){
  return fetch ({
      url:'/api/scoremanagementservice/labourParam',
      method:'get',
  })
}

//保存
function LaborEducaSave(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourParam',
      method:'post',
      data
  })
}

// 生活技能培养学时管理列表查询
function labourLiftlist(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourPracticeHour/list',
      method:'post',
      data
  })
}

// 生活技能培养学时管理列表添加
function labourLiftAdd(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourPracticeHour',
      method:'post',
      data
  })
}



//删除
function labourLiftDel(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourPracticeHour',
      method:'DELETE',
      data
  })
}
//详情
function labourLiftDetails(id){
  return fetch ({
      url:`/api/scoremanagementservice/labourPracticeHour/${id}`,
      method:'get',

  })
}
//编辑
function labourLiftedit(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourPracticeHour',
      method:'PUT',
      data
  })
}

//实践环节学时汇总查询
function groupQuerylist(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourPracticeHour/groupQuery',
      method:'POST',
      data
  })
}
//实践环节学时汇总查询(详情)
function groupQuerylistTwo(data){
  return fetch ({
      url:`/api/scoremanagementservice/labourPracticeHour/list/${data.studentId}/${data.plateId}`,
      method:'get',
  })
}
//导出----实践环节学时汇总查询
function exportLabourPractice(data){
  return fetch({
      url:'/api/scoremanagementservice/labourPracticeHour/groupQuery/excel',
      data,
      method:'post',
      headers: { 'Content-Type': 'application/json' },
  })
}

//导出----理论环节成绩管理
function exportData(data){
  return fetch({
      url:'/api/scoremanagementservice/labourTheoryScore/excel',
      data,
      method:'post',
      headers: { 'Content-Type': 'application/json' },
  })
}
/**
 * 循环获取导入状态-----理论环节成绩管理
 */
function getImportStatus(key) {
  return fetch({
      url: `${api_name}/${group_name_two}/import/${key}`,
      method: 'get'
  });
}
// 导入
export function getImportUrl() {
  return '/api/scoremanagementservice/labourTheoryScore/import'
}

// 六大模块---导出
function exportrPracticeHour(data){
  return fetch({
      url:'/api/scoremanagementservice/labourPracticeHour/excel',
      data,
      method:'post',
      headers: { 'Content-Type': 'application/json' },
  })
}

// // 六大模块---导入
// function importPracticeHours(key) {
//   return fetch({
//       url: `${api_name}/${group_name_two}/import/${key}`,
//       method: 'get'
//   });
// }

// 生活技能预警信息
function lifeSkillwarning(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourPracticeHour/lifeSkillHourWarning',
      method:'get',
  })
}
// 生活技能预警信息--查看名单列表
function WarningList(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourPracticeHour/lifeSkillHourWarningList',
      method:'POST',
      data
  })
}
//导出
function exportrlifeSkillHour(data){
  return fetch({
      url:'/api/scoremanagementservice/labourPracticeHour/lifeSkillHourWarning/excel',
      data,
      method:'post',
      headers: { 'Content-Type': 'application/json' },
  })
}



// 学院特色劳动实践预警信息
function collegeCharacwarning(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourPracticeHour/collegeWarning',
      method:'get',
  })
}

// 学院特色劳动实践--查看名单列表
function collegeCharaclist(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourPracticeHour/collegeWarningList',
      method:'POST',
      data
  })
}

//导出
function exportcollegeCharact(data){
  return fetch({
      url:'/api/scoremanagementservice/labourPracticeHour/collegeWarningList/excel',
      data,
      method:'post',
      headers: { 'Content-Type': 'application/json' },
  })
}


//查询成绩
function queryFinalResultlist(data){
  return fetch ({
      url:'/api/scoremanagementservice/labourPracticeHour/queryFinalResult',
      method:'POST',
      data
  })
}

//最终成绩
function optionFinallistapi(data){
  return fetch ({
      url:'/api/scoremanagementservice/scoreSettingController/queryScoreRecordList',
      method:'POST',
      data
  })
}

//根据学号查询某学生明细
//最终成绩
function queryFinalDetail(studentId){
  return fetch ({
      url:`/api/scoremanagementservice/labourPracticeHour/queryFinalDetail/${studentId}`,
      method:'get',
  })
}

//导出----成绩
function exportqueryFinal(data){
  return fetch({
      url:'/api/scoremanagementservice/labourPracticeHour/queryFinalResult/excel',
      data,
      method:'post',
      headers: { 'Content-Type': 'application/json' },
  })
}

//获取学生信息
export function selectStudentInfoByStuId(studentId) {
  return fetch({
    url: `/api/scoremanagementservice/labourTheoryScore/getDetailByStudentId/${studentId}`
  });
}

export default{
  labourTheoryScorelist,
  StudentInformation,
  labourTheoryScoreAdd,
  labourTheoryScoreedit,
  labourTheoryDetails,
  labourTheoryScoreDel,
  LaborEducation,
  LaborEducaSave,
  labourLiftlist,
  labourLiftAdd,
  labourLiftDetails,
  labourLiftDel,
  labourLiftedit,
  groupQuerylist,
  groupQuerylistTwo,
  exportData,
  getImportStatus,
  exportrPracticeHour,
  getImportUrl,
  lifeSkillwarning,
  WarningList,
  exportrlifeSkillHour,
  collegeCharacwarning,
  collegeCharaclist,
  exportcollegeCharact,
  queryFinalResultlist,
  optionFinallistapi,
  queryFinalDetail,
  exportqueryFinal,
  exportLabourPractice,
  selectStudentInfoByStuId
}
